Framework EDI Reference. Methods and Properties
ediTransport. Disconnect

Disconnects the existing connection that is currently open with the remote server.

Syntax:

Returns

Returns 1 if the operation is successful; otherwise 0 if the operation failed.

Remarks

An existing connection may or may not exist.  By default, a connection is opened and persists after every atomic transaction (send, receive, etc.) made with the remote server.  This connection will eventually close when this object is destroyed or released.

To modify the persistent connection setting, see ediTransport.EnablePersistentConnection.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oTransports As Fredi.ediTransports
Dim oTransport As Fredi.ediTransport

' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument

' Get transports object
Set oTransports = oEdiDoc.GetTransports

' Create single transport object for sending document.
Set oTransport = oTransports.CreateTransport

' Set required parameters for the upload.
oTransport.SetHTTP
oTransport.User = "UserID"
oTransport.Password = "password"
oTransport.Address = "www.somesite.com"
oTransport.TargetPath = "/FREDI_TEST/TestFiles/"

' Send external file.
oTransport.SendFile App.Path & "\SendTest.Txt"

' After the SendFile method, a connection to the remote
' server remains open. The connection is closed when
' the oTransport object is destroyed.
' For demo purposes, use the Disconnect method to forcibly
' close the connection.
oTransport.Disconnect

MsgBox "File sent"